-
Notifications
You must be signed in to change notification settings - Fork 104
Structured outputs #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Structured outputs #463
Conversation
openai-java-core/src/main/kotlin/com/openai/models/chat/completions/StructuredChatCompletion.kt
Outdated
Show resolved
Hide resolved
openai-java-core/src/main/kotlin/com/openai/models/chat/completions/StructuredChatCompletion.kt
Outdated
Show resolved
Hide resolved
...e/src/main/kotlin/com/openai/models/chat/completions/StructuredChatCompletionCreateParams.kt
Outdated
Show resolved
Hide resolved
...a-core/src/main/kotlin/com/openai/models/chat/completions/StructuredChatCompletionMessage.kt
Outdated
Show resolved
Hide resolved
openai-java-core/src/main/kotlin/com/openai/core/JsonSchemaValidator.kt
Outdated
Show resolved
Hide resolved
8c0d60a
to
67381ff
Compare
} | ||
``` | ||
|
||
Pass the top-level class—`BookList` in this example—to `responseFormat(Class<T>)` when building the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass the top-level class—`BookList` in this example—to `responseFormat(Class<T>)` when building the | |
Pass the top-level class—`BookList` in this example to `responseFormat(Class<T>)` when building the |
List<String> books = new ArrayList<>(); | ||
|
||
StructuredChatCompletionCreateParams<BookList> params = ChatCompletionCreateParams.builder() | ||
.responseFormat(books.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.responseFormat(books.class) | |
.responseFormat(books.getClass()) |
(the previous code wouldn't have compiled)
```java | ||
List<String> books = new ArrayList<>(); | ||
|
||
StructuredChatCompletionCreateParams<BookList> params = ChatCompletionCreateParams.builder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StructuredChatCompletionCreateParams<BookList> params = ChatCompletionCreateParams.builder() | |
StructuredChatCompletionCreateParams<List<String>> params = ChatCompletionCreateParams.builder() |
Includes optional local JSON schema validation and draft SDK documentation.